#include <stdio.h>  
#include <stdlib.h>  
  
void reverse(char str[], int start, int end) {  
    if (start >= end)  
        return ;  
    char temp = str[start];  
    str[start] = str[end];  
    str[end] = temp;  
    reverse(str, start + 1, end - 1);  
}  
  
int main( ) {  
    char str[100];  
    int start, end;  
    gets(str);  
    scanf("%d%d", &start, &end);  
    if (start > strlen(str))  
        start = end;  
    if (end > strlen(str))  
        end = strlen(str) - 1;  
    reverse( str, start, end );  
    printf("%s\n", str);  
    return 0;  
}  